package com.shtel.bss.saas.tenant.entity;

import java.util.Date;
import com.shtel.bss.saas.core.data.common.entiry.IAbsBaseEntity;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import com.shtel.bss.saas.core.base.spring.ApplicationContextUtil;
import com.shtel.bss.saas.tenant.entity.repository.ISysGlobalIpRepository;

/**
 * ip控制表
 * @author xiezhiwei 2020-02-05 21:09
 */
@Table(name = "SYS_GLOBAL_IP")
public class SysGlobalIp extends IAbsBaseEntity<Long> {
	
    /**
     * 开始时间
     * 
     */
	@Column(name = "BEGIN_TIME")
	private Date beginTime;
    /**
     * 创建时间
     * 
     */
	@Column(name = "CREATE_TIME")
	private Date createTime;
    /**
     * 创建人
     * 
     */
	@Column(name = "CREATE_USER_ID")
	private Long createUserId;
    /**
     * 结束时间
     * 
     */
	@Column(name = "END_TIME")
	private Date endTime;
    /**
     * IP结束段
     * 
     */
	@Column(name = "IP_END")
	private String ipEnd;
    /**
     * ip主键ID
     * 
     */
	@Id
	@Column(name = "IP_ID")
	private Long ipId;
    /**
     * IP开始段
     * 
     */
	@Column(name = "IP_START")
	private String ipStart;
    /**
     * ip类型(0:黑名单;1:白名单)
     * 
     */
	@Column(name = "IP_TYPE")
	private byte ipType;
    /**
     * 删除标识(1已删除 0未删除)
     * 
     */
	@Column(name = "IS_DELETE")
	private byte isDelete;
    /**
     * 是否不可修改(1:不可修改;0:可修改)
     * 
     */
	@Column(name = "IS_FINAL")
	private byte isFinal;
    /**
     * 是否有效(1:有效;0:无效)
     * 
     */
	@Column(name = "IS_VALID")
	private byte isValid;
    /**
     * 修改时间
     * 
     */
	@Column(name = "MODIFY_TIME")
	private Date modifyTime;
    /**
     * 修改人
     * 
     */
	@Column(name = "MODIFY_USER_ID")
	private Long modifyUserId;
    /**
     * 时间限制类型(0:限时;1:永久)
     * 
     */
	@Column(name = "TIME_LIMIT_TYPE")
	private byte timeLimitType;

	public static ISysGlobalIpRepository repository() {
		return (ISysGlobalIpRepository) ApplicationContextUtil.getBean("sysGlobalIpRepository");
	}
	
    public void setBeginTime(Date beginTime) {
    	this.beginTime = beginTime;
    }
    
    public Date getBeginTime() {
	   return beginTime;
    }
    
    public void setCreateTime(Date createTime) {
    	this.createTime = createTime;
    }
    
    public Date getCreateTime() {
	   return createTime;
    }
    
    public void setCreateUserId(Long createUserId) {
    	this.createUserId = createUserId;
    }
    
    public Long getCreateUserId() {
	   return createUserId;
    }
    
    public void setEndTime(Date endTime) {
    	this.endTime = endTime;
    }
    
    public Date getEndTime() {
	   return endTime;
    }
    
    public void setIpEnd(String ipEnd) {
    	this.ipEnd = ipEnd;
    }
    
    public String getIpEnd() {
	   return ipEnd;
    }
    
    public void setIpId(Long ipId) {
    	this.ipId = ipId;
    }
    
    public Long getIpId() {
	   return ipId;
    }
    
    public void setIpStart(String ipStart) {
    	this.ipStart = ipStart;
    }
    
    public String getIpStart() {
	   return ipStart;
    }
    
    public void setIpType(byte ipType) {
    	this.ipType = ipType;
    }
    
    public byte getIpType() {
	   return ipType;
    }
    
    public void setIsDelete(byte isDelete) {
    	this.isDelete = isDelete;
    }
    
    public byte getIsDelete() {
	   return isDelete;
    }
    
    public void setIsFinal(byte isFinal) {
    	this.isFinal = isFinal;
    }
    
    public byte getIsFinal() {
	   return isFinal;
    }
    
    public void setIsValid(byte isValid) {
    	this.isValid = isValid;
    }
    
    public byte getIsValid() {
	   return isValid;
    }
    
    public void setModifyTime(Date modifyTime) {
    	this.modifyTime = modifyTime;
    }
    
    public Date getModifyTime() {
	   return modifyTime;
    }
    
    public void setModifyUserId(Long modifyUserId) {
    	this.modifyUserId = modifyUserId;
    }
    
    public Long getModifyUserId() {
	   return modifyUserId;
    }
    
    public void setTimeLimitType(byte timeLimitType) {
    	this.timeLimitType = timeLimitType;
    }
    
    public byte getTimeLimitType() {
	   return timeLimitType;
    }
    
	@Override
	public Long getId() {
		return getIpId();
	}

	@Override
	public void setId(Long id) {
		setIpId(id);
	}
}